import { createSlice } from "@reduxjs/toolkit";

const userStore = createSlice({
  name: "user",
  initialState: {
    profile: {},
  },
  reducers: {
    setProfile(state, action) {
      state.profile = action.payload;
    },
    clearProfile(state) {
      state.profile = {};
    },
  },
});

const { setProfile, clearProfile } = userStore.actions;
const userReducer = userStore.reducer;

export { setProfile, clearProfile };
export default userReducer;
